package com.bainuo.doctor.common.widget;

import android.content.Context;
import android.util.AttributeSet;

import com.bainuo.doctor.common.widget.ptr.PtrClassicDefaultHeader;
import com.bainuo.doctor.common.widget.ptr.PtrFrameLayout;


/**
 * Description:下拉刷新
 * Created by MonkeyShen on 2017/1/18.
 * Mail:shenminjie92@sina.com
 */

public class CustomRefreshLayout extends PtrFrameLayout {

    /**
     * headerView
     */
    CustomRefreshHeader mHeaderView;

    public CustomRefreshLayout(Context context) {
        super(context);
        initView();
    }

    public CustomRefreshLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView();
    }

    public CustomRefreshLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initView();
    }


    /**
     * 初始化view
     */
    private void initView() {
        mHeaderView = new CustomRefreshHeader(getContext());
        setHeaderView(mHeaderView);
        addPtrUIHandler(mHeaderView);
        addPtrUIHandler(new PtrClassicDefaultHeader(getContext()));
//        final StoreHouseHeader header = new StoreHouseHeader(getContext());
//        header.initWithString("BaiNuo");
//        header.setPadding(0, SizeUtils.dp2px(15), 0, SizeUtils.dp2px(15));
//        header.setTextColor(ResourcesCompat.getColor(getResources(), R.color.primary_text, null));
//        setHeaderView(header);
//        addPtrUIHandler(header);
    }
}
